import java.util.Scanner;
import java.util.*;
public class MC0339出去玩 {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        // code here
        int A = input.nextInt();
        int B = input.nextInt();
        int C = input.nextInt();
        int D = input.nextInt();
        System.out.println(Math.min(A,C)+Math.min(B,D));//通过
//        System.out.println(Math.min(A+C, B+D));//不通过
        input.close();
    }
}
